package com.wj.springcloud;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * @description: payment启动类
 * @author: wj
 * @create: 2021/5/12 10:48
 */
@SpringBootApplication
@EnableDiscoveryClient
public class PaymentMain8001 {
    private static Logger logger = LoggerFactory.getLogger(PaymentMain8001.class);

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(PaymentMain8001.class, args);
        ConfigurableEnvironment environment = applicationContext.getEnvironment();
        String serverPort = environment.getProperty("server.port");
        String contextPath = environment.getProperty("server.servlet.context-path");
        String url = "http://127.0.0.1:"+serverPort+"/doc.html";
        logger.info("项目启动成功，swagger访问地址是：{}",url);
    }
}